package com.leo.boot.util;

import lombok.Data;
import lombok.NonNull;
import lombok.experimental.UtilityClass;

import static java.lang.System.getProperty;
import static java.lang.ThreadLocal.withInitial;

@UtilityClass
public class RequestContext {

    public static final ThreadLocal<User> USER = withInitial(() -> new User(getProperty("user.name")));

    @Data
    public static class User {

        @NonNull
        String userId;
    }
}
